package com.zz.bid.util;


import io.jsonwebtoken.JwtParser;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.impl.DefaultJwtParser;

public class JWTHandler {
    private static JwtParser jwtParser = new DefaultJwtParser();

    public static String decodeJwt(String jwt) {
        return Jwts.parser().parseClaimsJwt(jwt).getBody().getSubject();
    }

    public static String encodeJwt(String token) {
        return Jwts.builder().setSubject(token).compact();
    }

    public static void main(String[] args) {
        String s = "2020-03-03 00:00:00";
        System.out.println(s.substring(0,15));
    }
}
